//定义常量构造函数 类中的变量必须用final修饰
//构造函数用const修饰
class Container {
  final String name;
  final int age;
  const Container({required this.name, required this.age});
}

void main() {
  var c1 = Container(name: "张三", age: 20);
  var c2 = Container(name: "张三", age: 20);
  print(identical(c1, c2));

  //用const实例化的类的构造函数必须是常量构造函数
  var c3 = const Container(name: "李四", age: 18);
  var c4 = const Container(name: "李四", age: 18);
  print(identical(c3, c4));
}
